<?php
class Brand extends Auth_Controller {
	
	function __construct(){
		parent::__construct();
		$this->load->model('goods/BrandModel', '' , true);
	}
	
	function index(){
		
		$view_data['action'] = 'list';
		$this->_view('/manager/goods/brand',$view_data);
	}
	
	/**
	 * 检测名称是否存在
	 * @param 名称 $name
	 */
	function isExistName($name) {
		$name = urldecode($name);
		$data['state'] = $this->BrandModel->count(array('name'=>$name));
		$this->_output_json($data);
	}
	
	function add(){
		$view_data['form'] = $this->_form('brand','/manager/goods/brand/doadd', '/manager/goods/bean/fb_brand.php');
		$view_data['action'] = 'add';
		$this->_view('manager/goods/brand',$view_data);
	}
}